﻿using BingoClientModel;
using BingoServerCommon.Common;
using System;

namespace BingoGameServerConsole
{
	/// <玩家选择房间卡片 />
	public class PackageSelectCard : Package
	{


		public PackageSelectCard(EnumPackCommand mainid) : base(mainid)
		{
		}

		public PackageSelectCard(byte[] buffer, int len) : base(buffer, len)
		{
		}

		public override Package Clone(byte[] bytes)
		{
			return new PackageSelectCard(bytes, bytes.Length);
		}
		/// <summary>
		/// 
		/// </summary>
		public override void Excute(BaseRoom baseroom, Session session)
		{
            User user = (User)session.player;
            Room room = (Room)baseroom;

            ushort num = this.ReadUShort();//选择的卡片数
            ushort mult = this.ReadUShort();//选择的倍数

            Console.WriteLine($"{user.id} 选择卡片 num={num} mult={mult}");
            room.UserSelectCard(user,num, mult);
        }
	}
}
